package com.ynet.finmall.file.aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

import com.alibaba.fastjson.JSONObject;
import com.ynet.finmall.file.model.ImRoleProject;

@Aspect
@Component
public class FunctionAspect {
	
	@Pointcut("execution (* com.ynet.finmall.controller.*(..))")
	public void declareJoinPointExpression() {
	}
	
	@Around(value = "declareJoinPointExpression()")
	public Object around(ProceedingJoinPoint pjp) throws Throwable {

		//入参校验
		Object[] object = pjp.getArgs();
		String resultString = JSONObject.toJSONString(object[0]);
		
//		if ((object[0] instanceof AbstractYLBRequest)) {
//		}
		
		Object obj = null;
		obj = pjp.proceed();
		
		//出参校验
		String reqStr = JSONObject.toJSONString(obj);
		if(obj instanceof ImRoleProject){
			
		}
		
		return obj;
	
	}
}
